package com.sylar.happygps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class LoadingActivity extends Activity{

	private Handler mHandler = new Handler(){
		public void handleMessage(android.os.Message msg) {
			switch (msg.what) {
			case 100:
				Intent intent = new Intent(LoadingActivity.this,MainActivity.class);
				startActivity(intent);
				LoadingActivity.this.finish();
				break;
			}
		};
	};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ImageView img = new ImageView(getApplicationContext());
		img.setImageResource(R.drawable.loading);
		img.setScaleType(ScaleType.FIT_XY);
		setContentView(img);
		
		mHandler.sendEmptyMessageDelayed(100, 1500);
	}
}
